class CPU:
    pass
class Disk:
    pass
class Computer:
    def __init__(self,cpu,disk):
        self.cpu = cpu
        self.disk = disk

cpu1=CPU()
cpu2=cpu1
print(cpu1)
print(cpu2)
print('-----------------------------')
#类有浅拷贝
disk=Disk()  #硬盘类的实例对象
computer=Computer(cpu1,disk)  #计算机类的实例对象

#浅拷贝
import copy
computer2=copy.copy(computer)
print(computer,computer.cpu,computer.disk)
print(computer2,computer2.cpu,computer2.disk)

#深拷贝
computer3=copy.deepcopy(computer)
print(computer,computer.cpu,computer.disk)
print(computer3,computer3.cpu,computer3.disk)
